<template>
  <div id="app">
    <router-view v-if="isRouterAlive"></router-view>
  </div>
</template>
<script>
export default {
  name: "App",
  provide () {    //父组件中通过provide来提供变量，在子组件中通过inject来注入变量。                                             
    return {
      reload: this.reload                                              
    }
  },
  data() {
    return {
      isRouterAlive: true
    }
  },
  created() {
    this.$store.dispatch("app/findAllTag");
  },
  methods: {
    reload () {
      this.isRouterAlive = false; // 先关闭，
      this.$nextTick(function () {
        this.isRouterAlive = true; // 再打开
      }) 
    }
  },
  /* beforeDestroy() {
    this.$store.dispatch('user/logout')
    this.$router.push('/login')
  } */
};
</script>

<style lang="scss">
#app {
  word-break: break-all;
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
//滚动条的滑块
::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: #1890ff;
}
</style>
